﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BoriPeter.NutritionManager.FatSecret
{
    public class FoodGetMessage : MessageBase
    {
        private const string METHOD_VALUE = "food.get";
        private const string FOOD_ID = "food_id";

        public async Task<FoodGetModel> SendAsync()
        {
            var response = await SendDataAsync(RequestUrl);
            var messageModel = XmlDeserializeFromString<FoodGetModel>(response);

            return messageModel;
        }

        public FoodGetMessage(int foodId)
            : base()
        {
            AddMessageParameter(METHOD, METHOD_VALUE);
            //AddMessageParameter(OAUTH_TOKEN, OAuthToken);
            AddMessageParameter(FOOD_ID, foodId);
        }
    }
}
